<!DOCTYPE html>
<html>
<head>
{include file="common/head"}
<style type="text/css">
<!--
.w_census {
    margin: 20px;
}
.w_census span {
	display: inline-block;
	width: 33.33%;
	text-align: center;
	font-size: 18px;
}
-->
</style>
</head>

<body style="background-color: #f2f2f2;">
{include file="common/header"}
  <div class="layui-container" style="margin-top: 80px;">
  
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <div class="layui-row" style="padding: 15px;">
              <div class="layui-col-md8">
	            <div style="display: inline-block;"><div class="portrait-lg">{:portrait($user.id)}</div></div>
	            <div style="display: inline-block;">
	            	<h1>{$user.username}</h1>
	            	<p style="color: #888;"><i class="layui-icon" style="color: #1E9FFF;font-size: 18px;">&#xe642;</i>  {if empty($user.members.usersign) eq 1}生活不止有眼前的苟且，还有诗和远方{else}{$user.members.usersign}{/if}</p>
	            </div>
              </div>
              <div class="layui-col-md4" style="text-align: center;">
                <a href="{:url('wendasns/common/follow')}" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary J_req" data-json='{"uid":"{$user.id}","type":"1"}' data-click="follow">{if $fans}取消关注{else}关注{/if}</a><button class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary">发私信</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  
  
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md9">
        <div class="layui-card">
          <div class="layui-card-body">
            <div class="layui-tab layui-tab-brief">
              <ul class="layui-tab-title">
                <li{if $dispatch eq 'index'} class="layui-this"{/if}><a href="{:url('wendasns/home/index',['dispatch'=>'index','id'=>$user.id],false)}">提问{$user.datas.ask}</a></li>
                <li{if $dispatch eq 'answer'} class="layui-this"{/if}><a href="{:url('wendasns/home/index',['dispatch'=>'answer','id'=>$user.id],false)}">回复{$user.datas.answer}</a></li>
                <li{if $dispatch eq 'article'} class="layui-this"{/if}><a href="{:url('wendasns/home/index',['dispatch'=>'article','id'=>$user.id],false)}">文章{$user.datas.article}</a></li>
              </ul>
              <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                  {volist name="logs" id="item"}
                  {if $dispatch eq 'article'}
                  	<p><a href="{:url('wendasns/article/show',$item)}" style="color: #000;">{$item.title}</a></p>
                  	<p style="color: #999;font-size: 12px;"><span>{$item.visits} 阅读 · {$item.praise}人喜欢</span><span style="margin-left: 25px;">{:range_time($item.create_time)}</span></p>
                  {elseif $dispatch eq 'answer'}
                  	<p><a href="{:url('wendasns/question/show',$item.questions)}" style="color: #000;">{$item.questions.title}</a></p>
                  	<p style="color: #7A8F9A;">{:substr_format(strip_tags($item.content),190)}</p>
                  	<p style="color: #999;font-size: 12px;"><span>{$item.questions.visits} 阅读 · {$item.praise}人赞</span><span style="margin-left: 25px;">{:range_time($item.create_time)}</span></p>
                  {else}
                  	<p><a href="{:url('wendasns/question/show',$item)}" style="color: #000;">{$item.title}</a></p>
                  	<p style="color: #999;font-size: 12px;"><span>{$item.visits} 阅读</span><span style="margin-left: 25px;">{:range_time($item.create_time)}</span></p>
                  {/if}
                  
                  <hr>
                  {/volist}
                  <div class="pager">{$logs->render()|raw}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      
      <div class="layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">个人成就</div>
          <div class="layui-card-body">
          	<p>获得 <span class="layui-badge layui-bg-green">{$user.datas.praise}</span> 赞</p><hr class="layui-bg-gray">
          	<p>关注 <span class="layui-badge layui-bg-cyan">{$user.datas.follow}</span> 人</p><hr class="layui-bg-gray">
          	<p>粉丝 <span class="layui-badge layui-bg-blue">{$user.datas.fans}</span> 人</p>
          </div>
        </div>
      </div>
    </div>
    
  </div>
{include file="common/footer"}
</body>
</html>